import { getToken} from '@/utils/auth'

const user = {
  state: {
    token: getToken(),
    user: '',
    roles: [],
    sysUser: {}
  },

  mutations: {
    // 设置 token
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    // 设置用户信息
    SET_USER: (state, sysUser) => {
      state.sysUser = sysUser
    },
    // 设置角色权限
    SET_ROLES: (state, roles) => {
      state.roles = roles
    }
  },

  actions: {

  }
}

export default user
